<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>后台管理系统</title>
    <link rel="shortcut icon" href="" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/style/admin.css" media="all">
    <style>
        .wb-nav .snailfishicon{
            position: absolute;
            left: 20px;
            top: 50%;
            margin-top: -10px;
        }
        /*滚动条美化css 适合WebKit引擎的浏览器如chrome、oprea、Safari等*/
        ::-webkit-scrollbar {
            width: 16px;
        }

        ::-webkit-scrollbar-track,
        ::-webkit-scrollbar-thumb {
            border-radius: 999px;
            border: 5px solid transparent;
        }

        ::-webkit-scrollbar-track {
            box-shadow: 1px 1px 5px rgba(0,0,0,.2) inset;
        }

        ::-webkit-scrollbar-thumb {
            min-height: 20px;
            background-clip: content-box;
            box-shadow: 0 0 0 5px rgba(0,0,0,.2) inset;
        }

        ::-webkit-scrollbar-corner {
            background: transparent;
        }
    </style>
</head>
<body class="layui-layout-body">

<div id="LAY_app">
    <div class="layui-layout layui-layout-admin">
        <!--头部区域begin-->
        <div class="layui-header">
            <ul class="layui-nav layui-layout-left">
                <li class="layui-nav-item" lay-unselect="">
                    <a href="javascript:;" layadmin-event="refresh" title="刷新">
                        <i class="layui-icon layui-icon-refresh-3"></i>
                    </a>
                </li>
                <span class="layui-nav-bar" style="left: 30px; top: 48px; width: 0px; opacity: 0;"></span>
            </ul>
            <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
                <li class="layui-nav-item layui-hide-xs" lay-unselect >
                    <a href="javascript:void(0);">
                        <font  style="color:#009688;">
                            欢迎登陆：{#$admin_info.user_login}
                        </font>
                    </a>
                </li>
                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a data-href="{#:U('Admin/clear_cache')}" class="topHrefBind" style="cursor: pointer;">清除缓存</a>
                </li>
                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a href="{#:U('Public/logout')}">退出</a>
                </li>
                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a href="javascript:;" layadmin-event="fullscreen">
                        <i class="layui-icon layui-icon-screen-full"></i>
                    </a>
                </li>
                <span class="layui-nav-bar" style="left: 28px; top: 48px; width: 0px; opacity: 0;"></span>
            </ul>
        </div>
        <!--头部区域end-->
        <!--左侧导航区域begin--->
        <div class="layui-side layui-side-menu">
            <div class="layui-side-scroll">
                <!-- logo -->
                <div class="index-inner-container">
                    <div class="layui-logo">
                        <a href="{#:U('index')}">
                            后台管理
                        </a>
                    </div>
                    <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
                        <span class="layui-nav-bar" style="height: 0px; top: 0px; opacity: 0;"></span>
                        <foreach name="admin_menu" item="vo" key="key" >
                        <li class="layui-nav-item" pinyin="<?php echo $key; ?>">
                            <a href="javascript:;" lay-href="" lay-direction="2">
                            <i class="layui-icon {#$vo['icon']}"></i>
                            <cite>{#$vo['title']}</cite>
                            </a>
                        </li>
                        </foreach>
                    </ul>
                </div>
            </div>
        </div>
        <!--左侧导航区域end--->
        <!--内容体begin-->
        <div class="layui-body" id="LAY_app_body">
            <div class="layadmin-tabsbody-item layui-show sub-nav-show">
                <!--二级菜单begin-->
                <div class="sub-nav">
                    <foreach name="admin_menu" item="menu" key="key" >

                    <div class="nav-new wb-subnav <?php if($key ==0){ ?> layui-this<?php } ?>">
                        <div class="subnav-scene">
                            {#$menu['subtitle']}
                        </div>
                        <?php foreach($menu['cat'] as $sub_menu){ ?>

                        <?php if( !empty($sub_menu['two_cat']) ){ ?>
                        <div class="menu-header">
                            <div class="menu-icon fa fa-caret-right layui-icon ">&#xe623;</div>
                            {#$sub_menu['title']}
                        </div>
                        <?php }else{ ?>
                        <ul style="display:block;">
                            <li  data-class="active">
                            <a href="javascript:;" lay-href="{#:U($sub_menu['url'])}" style="cursor: pointer;">{#$sub_menu['title']}</a>
                            </li>
                        </ul>
                        <?php } ?>

                        <?php if( !empty($sub_menu['two_cat']) ){ ?>
                        <ul style="display: none;">
                            <?php foreach($sub_menu['two_cat'] as $third_sub_menu){ ?>
                            <li class="" data-class="active">
                                <a lay-href="{#:U($third_sub_menu['url'])}" style="cursor: pointer;">{#$third_sub_menu['title']}</a>
                            </li>
                            <?php } ?>
                        </ul>
                        <?php } ?>

                        <?php } ?>
                    </div>
                    </foreach>
                </div>
                <!--二级菜单end-->
                <div class="new-iframe">
                    <iframe src="<?php echo U('Index/welcome'); ?>" frameborder="0" class="layadmin-iframe"></iframe>
                </div>
            </div>
        </div>
        <!--内容体end-->
    </div>
</div>
<style>
    .layui-side-menu .layui-nav .layui-nav-item>a{padding-top:4px;padding-bottom:4px}
    .layui-layout-admin .layui-side{width:120px}
    .layui-side-menu .layui-side-scroll{width:120px}
    .index-inner-container{position:absolute;left:0;top:0;right:-17px;bottom:0;overflow-x:hidden;overflow-y:scroll}
    .layui-layout-admin .layui-logo{position:fixed;left:0;top:0;z-index:1002;width:120px;height:65px;padding:0;box-sizing:border-box;overflow:hidden;font-weight:300;background-repeat:no-repeat;background-position:center center}
    .layui-side-menu .layui-nav{width:120px;margin-top:65px;background:0 0}
    .snailfishicon{position:absolute;top:32%;left:20px;font-size:16px}
    .layadmin-pagetabs,.layui-layout-admin .layui-body,.layui-layout-admin .layui-footer,.layui-layout-admin .layui-layout-left{left:120px}
    .new-iframe{position:absolute;left:0;top:0;bottom:0;right:0;overflow-x:auto;overflow-y:hidden}
    .sub-nav-show .new-iframe{left:126px}
    .sub-nav{width:115px;background-color:#fff;position:absolute;z-index:998;left:0;top:0;bottom:0;overflow-y:auto;display:none;box-shadow:2px 0 2px rgba(0,0,0,.05)}
    .sub-nav-show .sub-nav{display:block}
    .nav-new{display:none}
    .sub-nav-show .sub-nav .nav-new.layui-this{display:block}
    .one-nav{border-bottom:1px solid #e3e2e5;padding:12px 0}
    .one-nav:last-child{border-bottom:0}
    .one-nav .dt{font-weight:700}
    .one-nav a{color:#595959;line-height:32px;display:block;cursor:pointer}
    .dd p{margin:0 -10px 5px}
    .dd p a{padding:0 10px;font-size:13px}
    .dd p a:hover,.dd p.layui-this a{background-color:#e9eaf0;border-radius:3px}
    .layui-layout-admin .layui-body{position:fixed;top:60px}
    .layui-layout-admin .layui-body{top:50px}
    .wb-subnav .subnav-scene{overflow:hidden;height:78px;line-height:78px;padding-left:20px}
    .menu-header{line-height:50px;height:50px;cursor:pointer;padding-left:5px}
    .fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
    .menu-icon{width:20px;height:50px;float:left;text-align:center;font-size:8px;color:#666;line-height:50px}
    .fa-caret-down:before{content:"\f0d7"}
    :after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
    .wb-subnav ul{display:none;overflow:hidden}
    .wb-subnav ul li{height:50px;line-height:50px;font-size:12px}
    .wb-subnav ul li.active,.wb-subnav ul li:hover{background:#edf6ff}
    .wb-subnav ul a{padding-left:25px;height:100%;width:100%}
    .wb-subnav ul li a{color:#7c838a}
    .wb-subnav ul li.active a{color:#009688}
    .layadmin-side-shrink .layui-side{left:0;width:60px}
</style>
<script src="__PUBLIC__/layuiadmin/layui/layui.js"></script>
<script type="text/javascript">
    layui.config({
        base: '__PUBLIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use('index');
</script>

<script type="text/javascript">
    //由于模块都一次性加载，因此不用执行 layui.use() 来加载对应模块，直接使用即可：
    var layer = layui.layer;
    var $;
    var par_index = 0;
    var cur_open_div;
    var form;
    layui.use(['jquery', 'layer','form'], function(){
        $ = layui.$;
        $('.layui-side-scroll .layui-nav-item a').click(function(){
            var url = $(this).attr('lay-href');
            if( url == undefined || url == '')
            {
                var s_index = $(this).parent().index()-1;
                par_index = s_index;
                $('.wb-subnav').eq(s_index).addClass('layui-this').siblings().removeClass('layui-this');
                $('.layui-side-scroll .layui-nav-item').eq(par_index).addClass('layui-this').siblings().removeClass('layui-this');
            }else{
                var s_index = $(this).parent().parent().index()-1;
                par_index = s_index+1;
            }
            return false;
        });

        $('.wb-subnav li a').click(function(event){
            var s_url = $(this).attr('lay-href');
            $('.layadmin-iframe').attr('src', s_url);

        })
        $('#update_urlevent').click(function(event){
            var s_url = $(this).attr('lay-href');
            $('.layadmin-iframe').attr('src', s_url);

        })
        $('.wb-subnav li').click(function(event){
            $('.wb-subnav li').removeClass('active')
            $(this).addClass('active');
            $('.layui-side-scroll .layui-nav-item').eq(par_index).addClass('layui-this').siblings().removeClass('layui-this');
            var s_url = $(this).children('a').attr('lay-href');
            $('.layadmin-iframe').attr('src', s_url);
            event.stopPropagation();
        });
        $('.menu-header').click(function(){
            if( $(this).hasClass('active') )
            {
                //关闭 向右
                $(this).children('.layui-icon').html('&#xe623;');
                $(this).next().hide();
                $(this).removeClass('active');
            }else{
                //开启  向下
                $(this).children('.layui-icon').html('&#xe625;');
                $(this).next().show();
                $(this).addClass('active');
            }
        });
        $(".topHrefBind").click(function () {
            var url = $(this).attr('data-href');
            $('.layadmin-iframe').attr('src', url);
        })
    })
</script>
</body>
</html>